﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BLL;
using System.Data;

namespace PhamMemQuanLyHocSinh
{
    public partial class frmNhapDiem : Form
    {
        DataTable dtsinhvien;
        DataSet dsdanhsachlop;
        public frmNhapDiem()
        {
            InitializeComponent();
        }

        private void frmNhapDiem_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dsDiem.NOMON' table. You can move, or remove it, as needed.
           // this.nOMONTableAdapter.Fill(this.dsDiem.NOMON);
            // TODO: This line of code loads data into the 'dsDiem.DIEM' table. You can move, or remove it, as needed.
            //this.dIEMTableAdapter.Fill(this.dsDiem.DIEM);
            loaddgvsinvien();
            DoiTenDGV();
            DuaDuLieuVaoCMB();

        }

        private void DuaDuLieuVaoCMB()
        {
            cboLop.DataSource = NhapDiem_BLL.LoadCMBLop();
            cboLop.DisplayMember = "TENLOP";
            cboLop.ValueMember = "MALOP";
            cboLop.SelectedIndex = 1;

            cboMon.DataSource = NhapDiem_BLL.LoadCMBMon();
            cboMon.DisplayMember = "TENMONHOC";
            cboMon.ValueMember = "MAMONHOC";
            cboMon.SelectedIndex = 1;
        }

        private void DoiTenDGV()
        {
            dgvNhapDiem.Columns["MASV"].HeaderText = "Mã Sinh Viên";
            dgvNhapDiem.Columns["HOTEN"].HeaderText = "Họ Tên";
            dgvNhapDiem.Columns["NGAYSINH"].HeaderText = "Ngày Sinh";
            dgvNhapDiem.Columns["DIEMHS1"].HeaderText = "ĐIểm 15 Phút";
            dgvNhapDiem.Columns["DIEMHS2"].HeaderText = "Điểm 1 Tiết";
            dgvNhapDiem.Columns["DIEMTHI"].HeaderText = "Điểm Thi";
            dgvNhapDiem.Columns["DIEMCUOIKY"].HeaderText = "Điểm TB";
            dgvNhapDiem.Columns["GHICHU"].HeaderText = "Ghi Chú";



        }

        private void loaddgvsinvien()
        {
            dtsinhvien = NhapDiem_BLL.LoadDSSV();
            dgvNhapDiem.DataSource = dtsinhvien;
        }
       
    }
}
